<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateConsumableTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('consumable', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name', 100)->comment('耗材名称');
            $table->double('price')->comment('耗材报价');
            $table->double('weight')->comment('耗材毛重');
            $table->unsignedInteger('stock')->default(0)->comment('耗材库存');
            $table->unsignedInteger('length')->default(0)->comment('长');
            $table->unsignedInteger('width')->default(0)->comment('宽');
            $table->unsignedInteger('height')->default(0)->comment('高');
            $table->string('remark')->nullable()->comment('耗材说明');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('consumable');
    }
}
